<template>
  <el-menu
    router
    :default-active="$route.path"
    :key="$route.path"
    class="el-menu-demo"
    mode="horizontal"
    :ellipsis="false"
    @select="handleSelect"
  >
    <!-- <el-menu-item index="0"> </el-menu-item> -->
    <el-menu-item router="true" index="/home/index">
      <!-- <img class="svg-img" src="@/images/home.svg" alt="Home logo" /> -->
      Home
    </el-menu-item>
    <el-menu-item router="true " index="/crossBorder/index">
      Cross border
    </el-menu-item>
    <el-menu-item index="/tableOfContents/index">
      Table of contents
    </el-menu-item>
    <el-menu-item index="/method/index"> Method </el-menu-item>
    <el-menu-item index="/questionare/index"> Questionare </el-menu-item>
    <el-menu-item index="/safetyStudy/index"> Safety Study </el-menu-item>
    <el-sub-menu index="/solution/index">
      <template #title>
        <span style="font-size: 18px">Solution</span>
      </template>
      <el-menu-item index="/solution/accident/index"> Accident </el-menu-item>
      <el-menu-item index="/solution/chemical"> Chemical </el-menu-item>
      <el-menu-item index="/solution/equipment"> Equipment </el-menu-item>
      <el-menu-item index="/solution/consumable"> Consumable </el-menu-item>
      <el-menu-item index="/solution/experimentalPersonnel/index">
        ExperimentalPersonnel
      </el-menu-item>
      <el-menu-item index="/solution/wasteChemical">
        WasteChemical
      </el-menu-item>
      <el-menu-item index="/solution/safetyEducation">
        Safety Education
      </el-menu-item>
    </el-sub-menu>
  </el-menu>
  <div class="panel-body">
    <router-view></router-view>
  </div>
</template>

<script setup lang="ts" name="App">
import { ref } from "vue";

const activeIndex = ref("1");
const handleSelect = (key: string, keyPath: string[]) => {
  console.log(key, keyPath);
};
</script>

<style scoped>
.el-menu--horizontal > .el-menu-item:nth-child(8) {
  margin-right: auto;
}
.el-menu-item {
  font-size: 18px;
  width: 136px;
}
.svg-img {
  margin-right: 4px;
}
.svg-img:hover {
  margin-right: 4px;
  filter: drop-shadow(1000px 0 0 blue);
  transform: translate(-1000px);
}
.svg-img:active {
  margin-right: 4px;
  filter: drop-shadow(1000px 0 0 blue);
  transform: translate(-1000px);
}
</style>
